Specify the Application to Open for a Record and Run Session
Source code
'************************************************************************************************************************
'Description:
'
'This example opens OpenText Functional Testing without any add-ins loaded
'(standard Windows support only) and specifies the applications
'to be opened for the test.
'
'Assumptions:
'There is no unsaved test currently open in OpenText Functional Testing.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtStdLauncher 'As QuickTest.StdLauncher ' Declare a Windows Applications launcher variable
Dim qtStdApp 'As QuickTest.StdApplication ' Declare a StdApplication object variable
Dim strAdded ' Declare a string variable for the added applications

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

' Prepare application and test
qtApp.SetActiveAddins Array() ' Remove all add-ins from the collection so that OpenText Functional Testing opens with no add-ins loaded
qtApp.Launch ' Start OpenText Functional Testing
qtApp.Visible = True ' Make the OpenText Functional Testing application visible
qtApp.Test.SetAssociatedAddins Array() ' Remove all add-ins from the test's associated add-ins list.
Set qtStdLauncher = qtApp.Test.Settings.Launchers.Item("Windows Applications") ' Return the Windows Applications launcher

qtStdLauncher.Active = True ' Instruct OpenText Functional Testing to open applications when the record session begins

' Set the applications under test
qtStdLauncher.Applications.AddApplication "C:\Viewer.exe", "C:\" ' Add an application
qtStdLauncher.Applications.AddApplication "D:\Apps\Editor.exe", "D:\Apps" ' Add another application

' Save changes and clean up
qtApp.Test.SaveAs "C:\Tests\NewTest" ' Save the test
qtApp.Quit ' Exit OpenText Functional Testing
Set qtStdLauncher = Nothing ' Release the Windows Applications launcher object
Set qtApp = Nothing ' Release the Application object